package change;

import java.io.*;

/*
构造方法
InputStreamReader（InputStream in,String 编码方式）
OutputStreamWriter(OutputStream in,String 编码方式)
 */
public class Demo1 {
    public static void main(String[] args) throws IOException {
        OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream("E:\\changeFile.txt",true),"gbk");
        osw.write("\r\n");
        osw.write("以为幸福都可以掌握");
        osw.close();
    }

    private static void read() throws IOException {
        InputStreamReader isr = new InputStreamReader(new FileInputStream("E:\\changeFile.txt"),"GBK");
        int i;
        while ((i = isr.read()) != -1) {
            System.out.print((char) i);
        }
    }
}
